package com.yunao.commons.serachcore.core.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.List;

public class Article implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	private String title;
	private String content;
	private String summary; // 正文摘要，由关键词生成动态摘要，当关键词为未找到时，由指纹特征词生成静态摘要
	private String url;
	private Long datetime;
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date pubdate;
	private String author;
	private String images; // 相关图片，以“,”分隔
	private String videos; // 相关视频，以“,”分隔
	private String newsSource; // 来源，新闻的原创域名
	private String newsClassify; // 新闻分类，文本、图片、音频、视频
	private String domain;
	private String domainSource;
	private String mediaType;
	private String channel;
	private String emotion;
	private String authorType;
	private String messageType;
	private String location;
	private String domainLevel;
	private String sensitiveWords; // 文章涉及的敏感词
	private String highFrequencyWords; // 文章高频词
	private Integer domestic; // 是否境内，1：境内、2：境外
	private Long views;
	private Long comments;
	private Long likes;
	private Long reprints;
	private String nr;
	private String ns;
	private String nt;
	
	private List<Article> subs;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getDatetime() {
		return datetime;
	}

	public void setDatetime(Long datetime) {
		this.datetime = datetime;
	}

	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPubdate() {
		return pubdate;
	}

	public void setPubdate(Date pubdate) {
		this.pubdate = pubdate;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getImages() {
		return images;
	}

	public void setImages(String images) {
		this.images = images;
	}

	public String getVideos() {
		return videos;
	}

	public void setVideos(String videos) {
		this.videos = videos;
	}

	public String getNewsSource() {
		return newsSource;
	}

	public void setNewsSource(String newsSource) {
		this.newsSource = newsSource;
	}

	public String getNewsClassify() {
		return newsClassify;
	}

	public void setNewsClassify(String newsClassify) {
		this.newsClassify = newsClassify;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getDomainSource() {
		return domainSource;
	}

	public void setDomainSource(String domainSource) {
		this.domainSource = domainSource;
	}

	public String getMediaType() {
		return mediaType;
	}

	public void setMediaType(String mediaType) {
		this.mediaType = mediaType;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getEmotion() {
		return emotion;
	}

	public void setEmotion(String emotion) {
		this.emotion = emotion;
	}

	public String getAuthorType() {
		return authorType;
	}

	public void setAuthorType(String authorType) {
		this.authorType = authorType;
	}

	public String getMessageType() {
		return messageType;
	}

	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getDomainLevel() {
		return domainLevel;
	}

	public void setDomainLevel(String domainLevel) {
		this.domainLevel = domainLevel;
	}

	public String getSensitiveWords() {
		return sensitiveWords;
	}

	public void setSensitiveWords(String sensitiveWords) {
		this.sensitiveWords = sensitiveWords;
	}

	public String getHighFrequencyWords() {
		return highFrequencyWords;
	}

	public void setHighFrequencyWords(String highFrequencyWords) {
		this.highFrequencyWords = highFrequencyWords;
	}

	public Integer getDomestic() {
		return domestic;
	}

	public void setDomestic(Integer domestic) {
		this.domestic = domestic;
	}

	public Long getViews() {
		return views;
	}

	public void setViews(Long views) {
		this.views = views;
	}

	public Long getComments() {
		return comments;
	}

	public void setComments(Long comments) {
		this.comments = comments;
	}

	public Long getLikes() {
		return likes;
	}

	public void setLikes(Long likes) {
		this.likes = likes;
	}

	public Long getReprints() {
		return reprints;
	}

	public void setReprints(Long reprints) {
		this.reprints = reprints;
	}

	public String getNr() {
		return nr;
	}

	public void setNr(String nr) {
		this.nr = nr;
	}

	public String getNs() {
		return ns;
	}

	public void setNs(String ns) {
		this.ns = ns;
	}

	public String getNt() {
		return nt;
	}

	public void setNt(String nt) {
		this.nt = nt;
	}

	public List<Article> getSubs() {
		if (subs == null) {
			subs = Collections.emptyList();
		}
		return subs;
	}

	public void setSubs(List<Article> subs) {
		this.subs = subs;
	}

	@Override
	public String toString() {
		String res = id + "\t" + title;
		if (subs != null && !subs.isEmpty()) {
			for (Article sub : subs) {
				res += "\n\t" + sub.toString();
			}
		}
		return res;
	}

}
